﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using XNAGameFeatures.BasicGame;
using XNAGameFeatures.Features;
using XNAGameFeatures.Input;

namespace XNAGameFeatures.Widget
{
    public abstract class Widget : IGameObject
    {
        public static void InitWidget(Widget toInit, ScreenManager scre, ContentManager content = null)
        {
            toInit.SpriteBatch = scre.SpriteBatch;
            toInit.Viewport = scre.GraphicsDevice.Viewport;
            toInit.FontManager = scre.FontManager;
            toInit.Content = content ?? scre.Game.Content;
            toInit.ScreenManager = scre;
        }

        protected ScreenManager ScreenManager { get; set; }
        protected SpriteBatch SpriteBatch { get; set; }
        protected ContentManager Content { get; set; }
        protected Viewport Viewport { get; set; }
        protected FontManager FontManager { get; set; }

        public abstract void Draw(GameTime gameTime);
        public abstract void LoadContent();
        public abstract void UnloadContent();
        public abstract void Update(GameTime gameTime);
        public abstract void HandleInput(InputManager input);
    }
}
